package ch.zbw.pra.sysventory.ui.gui.panels.ueberpanel;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;

import ch.zbw.pra.sysventory.domain.factories.FileGenerator;
import ch.zbw.pra.sysventory.domain.factories.FileGenerator.FileType;
import ch.zbw.pra.sysventory.ui.gui.utilities.GuiLayout;

public class UeberPanel extends JPanel {
	private static final long serialVersionUID = -2377845684124595647L;

	private String title;
	private ImageIcon pgsPicture;

	public UeberPanel() {
		// super();
		this.title = null;
		init();
	}

	public void init() {
		this.pgsPicture = new ImageIcon(new FileGenerator().getFile(FileType.PGS_PICTURES)
				.getAbsolutePath());

		this.title = "*** SysVentory ***   RC V 0,1";
		GridBagLayout gridBagLayout = GuiLayout.getGridBagLayout(this);
		GridBagConstraints gridBagConstraints = GuiLayout.getGridBagConstraints();
		gridBagConstraints.insets = new Insets(5, 5, 5, 5);
		gridBagLayout.columnWidths = new int[] { 200, 200 };
		int x = 0;
		int y = 0;
		if (this.title != null) {
			GuiLayout.addNextRowToLayout(this, gridBagLayout, gridBagConstraints, x, y++,
					new JLabel("Softwareversion"), new JLabel(this.title));
		}
		x = 0;
		y++;
		GuiLayout.addNextRowToLayout(this, gridBagLayout, gridBagConstraints, x, y++, new JLabel(
				"Systemtechnik"), new JLabel("Silvan Gr\u00F6gli"));
		x = 0;
		y++;
		GuiLayout.addNextRowToLayout(this, gridBagLayout, gridBagConstraints, x, y, new JLabel(
				"Senior Software Engineer"), new JLabel("Mathias Spirig"));
		x = 0;
		y++;
		GuiLayout.addNextRowToLayout(this, gridBagLayout, gridBagConstraints, x, y, new JLabel(
				"Project Manager"), new JLabel("Christian Pf\u00E4ffli"));
		x = 0;
		y++;
		GuiLayout.addToLayout(this, gridBagLayout, gridBagConstraints, x, y, new JLabel(
				this.pgsPicture));
		this.setVisible(true);
	}
}
